import java.util.Arrays;

public class Test {
    @Override
    public String toString() {
        return "Test{}";
    }

    /*public Test() {
    }*/
    public static void main(String[] args) {
        StringBuilder s = new StringBuilder();
        s.append("aaa").append("bbb");
        s.append("ccc");
        System.out.println(s);
        s.reverse();
        System.out.println(s);
        String str = s.toString();
        String ss = "fkds";
        StringBuilder sss = new StringBuilder();
        sss.append(ss);
    }
    public static void main7(String[] args) {
        long start = System.currentTimeMillis();
        String s = " ";
        for(int i = 0; i < 10000; i++){
            s += i;
        }
        long end = System.currentTimeMillis();
        System.out.println(end - start);






         start = System.currentTimeMillis();
         StringBuffer stringBuffer = new StringBuffer(" ");
         for(int i = 0; i < 10000; i++){
             stringBuffer.append(i);
         }
         end = System.currentTimeMillis();
        System.out.println(end - start);

        start = System.currentTimeMillis();
        StringBuilder st = new StringBuilder(" ");
        for(int i = 0; i < 10000; i++){
            st.append(i);

        }
        end = System.currentTimeMillis();
        System.out.println(end - start);
    }
    public static void main6(String[] args) {
        String s = "word";
        s = s + "hello";
        System.out.println(s);

    }
    public static void main5(String[] args) {
        char[] ch = new char[]{'a','b','c'};
        String s1 = new String(ch);
        s1.intern();
        String s2 = "abc";
        System.out.println(s1 == s2);

    }
    public static void main4(String[] args) {
        String str = "   hello   ";
        System.out.println("["+str+"]");
        System.out.println("["+str.trim()+"]");

    }
    public static void main3(String[] args) {
        String str = "heeli=hhe&kk=ddie";
        String[] result = str.split("&");
        for (String s:result
             ) {
            String[] ss = s.split("=");
            for (String sss: ss){
                System.out.println((sss));
            }
        }
    }
    public static void main2(String[] args) {

        String str = "hello=dde";
        String[] spo = str.split("=");
        System.out.println(spo);
        System.out.println(Arrays.toString(spo));
    }
    public static void main1(String[] args) {
        String str = "abcdefg";
        String sub = str.substring(3,4);
        System.out.println(sub);
    }
}
